home *** CD-ROM | disk | FTP | other *** search
Wrap
#!/bin/sh # Because of the filenames in the directory /root/.nautilus and others # and the limitations on vfat fs, I had to do this # script that links all files put in the usbstick to /root/ and put the # nautilus and bluetooth dir in the ram... # Copyright 2005 Michael Zanetta grimmlin@pentoo.ch # Moving the dirs... mv /root/.nautilus /var/tmp/ mv /root/.gnome2 /var/tmp/ mv /root/.metacity /var/tmp/ mv /root/.kismet /var/tmp/ mv /root/.vnc /var/tmp/ # Different handling on .gconf as there is some problems with bluetooth devices and vfat (again) mv /root/.gconf /var/lib/ # Assuming it is the first time if [ ! -e /mnt/usbstick/pentoo/.pentoorc ]; then mkdir -p /mnt/usbstick/pentoo/root cp -a /root/ /mnt/usbstick/pentoo/ # Copying the gnome config to the usbstick mkdir -p /mnt/usbstick/pentoo/gnome/ mv /var/lib/.gconf/apps /mnt/usbstick/pentoo/gnome/ mv /var/lib/.gconf/desktop /mnt/usbstick/pentoo/gnome/ # Forcing the writing of the files echo -e " Writing the files on the usb memory stick" echo -e " This can take some time..." mount -o remount /mnt/usbstick/ echo -e " Done" fi find /mnt/usbstick/pentoo/root/ -name ".*" -printf %f\\t -maxdepth 1 > /var/tmp/rootfiles find /mnt/usbstick/pentoo/root/* -name "*" -printf %f\\t -maxdepth 0 >> /var/tmp/rootfiles # "Cleaning" the /root dir rm -rf /root mkdir /root/ chmod 1775 /root # Restoring dirs but first be sure there's no more apps or desktop cfg files rm -rf /var/lib/.gconf/apps rm -rf /var/lib/.gconf/desktop mv /var/tmp/.kismet /root/ mv /var/tmp/.vnc /root/ mv /var/tmp/.nautilus /root/ mv /var/tmp/.gnome2 /root/ mv /var/tmp/.metacity /root/ mv /var/lib/.gconf /root/ ROOT_LINKS=`cat /var/tmp/rootfiles` for x in ${ROOT_LINKS} do ln -s "/mnt/usbstick/pentoo/root/${x}" "/root/${x}" done ln -s /mnt/usbstick/pentoo/gnome/apps /root/.gconf/apps ln -s /mnt/usbstick/pentoo/gnome/desktop /root/.gconf/desktop # Putting an ultime link to the "physical" usbstick... ln -s /mnt/usbstick/pentoo/root/ /root/myusbstick # Ok, let's put some info for the user echo -en "Due to some limitation of the vfat filesystem, two directories can't be put on the usbstick...\nThis is why all files are linked to the stick.\nYou can access _physically_ your files by entering in the directory myusbstick." > /root/README_USB_STICK # Some cleaning rm -rf /var/tmp/rootfiles